#! /bin/sh

echo "Building version.c..."

if test -r version.c
then
   generation=`sed -n 's/^char \*generation = \"\(.*\)\";/\1/p' < version.c`
   if test ! "$generation" ; then generation=0; fi
else
   generation=0
fi

generation=`expr $generation + 1`

sumsserv="`(cd ../ircd; @SUM@ s_serv.c)`"
sumsuser="`(cd ../ircd; @SUM@ s_user.c)`"
sumchan="`(cd ../ircd; @SUM@ channel.c)`"
sumsbsd="`(cd ../ircd; @SUM@ s_bsd.c)`"
sumhash="`(cd ../ircd; @SUM@ hash.c)`"
sumsmisc="`(cd ../ircd; @SUM@ s_misc.c)`"
sumircd="`(cd ../ircd; @SUM@ ircd.c)`"

creation=`date | \
awk '{if (NF == 6) \
         { print $1 " "  $2 " " $3 " "  $6 " at " $4 " " $5 } \
else \
         { print $1 " "  $2 " " $3 " " $7 " at " $4 " " $5 " " $6 }}'`

cat >version.c <<!SUB!THIS!
/*
 *   IRC - Internet Relay Chat, ircd/version.c
 *   Copyright (C) 1990 Chelsea Ashley Dyerman
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 1, or (at your option)
 *   any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 * This file is generated by version.c.SH. Any changes made will go away.
 */

#include "os.h"
#include "s_defines.h"
#define VERSION_C
#include "s_externs.h"
#undef VERSION_C

char *generation = "$generation";
char *creation = "$creation";
char *version;				/* Filled by make_version() */
#ifdef SEND_ISUPPORT
char *isupport;				/* Filled by make_isupport() */
#endif
char *pass_version = PATCHLEVEL;

char *infotext[] =
    {
	"RusNet IRC daemon",
	"Based on the original code written by Jarkko Oikarinen",
	"Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
	"Copyright 1997-2011 RusNet Developers Team",
	"",
	"This program is free software; you can redistribute it and/or "
	"modify it under the terms of the GNU General Public License as "
	"published by the Free Software Foundation; either version 1, or "
	"(at your option) any later version.",
	"",
	"The following persons have made many changes and enhancements to the "
	"code and still know how IRC really works if you have questions about it:",
	"",
	"syrk         Christophe Kalt          kalt@stealth.net",
	"",
	"Thanks to the following people for help with preparing 2.10",
	"",
	"Beeth        Piotr Kucharski          chopin@sgh.waw.pl",
	"Q            Kurt Roeckx              Q@ping.be",
	"Core         Magnus Tjernstrom        d92-mtm@ludd.luth.se",
	"",
	"Those who helped in prior versions and continue to be helpful:",
	"",
	"Jarkko Oikarinen",
	"Darren Reed         Vesa Ruokonen",
	"Matthew Green       Chuck Kane          Matt Lyle",
        "Markku Savela       Greg Lindahl        Armin Gruner",
 	"Stellan Klebom      Dan Goodwin         Mike Bolotski",
	"Ian Frechette       Markku Jarvinen     Kimmo Suominen",
	"Jeff Trim           Vijay Subramaniam   Karl Kleinpaste",
	"Bill Wisner         Tom Davis           Hugo Calendar",
	"Tom Hopkins         Stephen van den Berg",
	"Bo Adler            Michael Sandrof     Jon Solomon",
	"Jan Peterson        Helen Rose          Paul Graham",
	"",
	"Thanks also goes to those persons not mentioned here who have added "
	"their advice, opinions, and code to IRC.",
	"Thanks also to those who provide the kind sys admins who let me and "
	"others continue to develop IRC.",
	"",
	"The following people are RusNet IRC team who made their commitments "
	"to RusNet IRCd project:",
	"",
	"skold               Aristotle Symplides",
	"az                  Alex Zhilyakov",
	"erra                Seva Gluschenko",
	"baron               Alexander Dubovikov",
	"cj                  Seva Jitomirsky",
	"Adel                Adel Abushaev",
	"LoSt                Andrij Gritsenko",
	"kmale               Kirill Pushkaryov",
	"Umka                Alexey Lyashkov",
	"denk                Denis Kozadaev",
	"[$sumsserv] [$sumchan] [$sumsbsd] [$sumsuser]",
	"[$sumhash] [$sumsmisc] [$sumircd]",
	0,
    };
!SUB!THIS!
